﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    public class SecretNumber
    {
        public string Value { get; set; }

        public SecretNumber(string value)
        {
            this.Value = value;
        }

        /// <summary>
        /// This method compare accepted num2 with current num to see how many
        /// digit appears in both numbers in the same position
        /// </summary>
        /// <param name="num2"></param>
        public int CompareWithSamePosition(SecretNumber num2)
        {
            int count=0;
            for (int i=0; i < num2.Value.Length; i++)
                if (num2.Value[i].Equals(this.Value[i]))
                    count++;

            return count;
        }
    }
}
